package com.vivo.java.charset;
import java.io.UnsupportedEncodingException;

public class 编码 {

	public void testChangeCharset() {
		try {
			// utf8编码字符串
			String string = "abc\u5639\u56fb";
			// 取得bytes
			byte[] utf8 = string.getBytes("UTF-8");
			// 输出utf8编码的文字
			System.out.println(new String(utf8, "UTF-8"));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] a) {
		编码 b = new 编码();
		b.testChangeCharset();
	}
}
